home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 2,801 to 2,900 / aol-file-protocol-4400-2801-to-2900.zip / AOLDLs / C++ Files Library / HyperCuber Source / HyperCuber 2.0 Source.sit / HyperCuber 2.0 Source / CAboutDialog.cp < prev    next >
Text File  |  1994-05-01  |  2KB  |  97 lines

  1. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. //| CAboutDialog.cp
  3. //|
  4. //| This implements the about... dialog
  5. //|_________________________________________________________
  6.  
  7. #include "CAboutDialog.h"
  8.  
  9. #include <CButton.h>
  10. #include <CDecorator.h>
  11. #include <CEditText.h>
  12. #include <CPicture.h>
  13.  
  14. extern CDecorator *gDecorator;
  15.  
  16. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  17. //| CAboutDialog::IAboutDialog
  18. //|
  19. //| Purpose: Initialize the about dialog.
  20. //|
  21. //| Parameters: WindowID:   ID of WIND resource to use
  22. //|             enclosure:  the Desktop
  23. //|             supervisor: the supervisor of this DialogDirector
  24. //|             low_memory: TRUE if memory is low, and the PICT should not be
  25. //|                         displayed.
  26. //|______________________________________________________________________________
  27. void CAboutDialog::IAboutDialog(short WindowID, CDesktop *enclosure,
  28.                                     CDirector *supervisor, short pict_id)
  29. {
  30.  
  31. #define OKAY_BUTTON_ID        130
  32.  
  33. #define LOW_MEM_PICT_ID        129
  34.  
  35.     CPicture    *picture = NULL;
  36.     CEditText    *text = NULL;
  37.     CButton        *button = NULL;
  38.  
  39.     TRY
  40.     {
  41.     
  42.     CDialog::IDialog(WindowID, enclosure, supervisor);    //  Initialize as CDialog
  43.  
  44.     if (pict_id)
  45.         {
  46.  
  47.         CPicture *picture = new(CPicture);                //  Set up the picture
  48.         picture->IPicture(this, this, 500, 400, 10, 10,
  49.                             sizFIXEDLEFT, sizFIXEDTOP);
  50.         picture->UsePICT(pict_id);
  51.         picture->SetScaled(FALSE);
  52.         picture->FrameToBounds();
  53.         picture->SetWantsClicks(TRUE);
  54.         picture->CenterWithinEnclosure(TRUE, TRUE);
  55.  
  56.         CEditText *text = new(CEditText);                //  Set up the version number text
  57.         text->IEditText(this, this, 100, 20,
  58.                         307 - 30*(pict_id == LOW_MEM_PICT_ID),
  59.                         127,
  60.                         sizFIXEDLEFT, sizFIXEDTOP, -1);
  61.         text->SetTextString("\pVersion 2.0");
  62.         text->SetFontNumber(geneva);
  63.         text->SetFontSize(9);
  64.         text->SetWantsClicks(FALSE);
  65.         text->Specify(kNotEditable, kNotSelectable,
  66.                         kNotStylable);
  67.         }
  68.     
  69.     else
  70.         SysBeep(0);                                        //    don't draw anything in the window
  71.     
  72.     CButton *button = new(CButton);                        //  Set up the okay button
  73.     button->IButton(OKAY_BUTTON_ID,
  74.                             this, this);
  75.     button->Offset(420, 250, TRUE);
  76.     button->SetClickCmd (cmdOK);
  77.     SetDefaultButton(button);
  78.     
  79.     gDecorator->CenterWindow (this);                    //  Center the window on the screen
  80.  
  81.     Select();
  82.     Update();
  83.     
  84.     }
  85.     
  86.     CATCH
  87.     {
  88.     
  89.     ForgetObject(picture);                                //  clean up
  90.     ForgetObject(button);
  91.     ForgetObject(text);
  92.  
  93.     }
  94.     ENDTRY;
  95.  
  96.     
  97. }    //=== CPrefsDialog::IPrefsDialog() ===\\